Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: don't try to decode an empty body #631

Merged
merged 1 commit into from
Sep 19, 2023
Merged

Conversation

Vinzent03
Copy link
Collaborator

What kind of change does this PR introduce?

Bug fix

What is the current behavior?

A FormatException is thrown on when trying to parse an empty body

What is the new behavior?

The empty body is caught and no decoding is happening.

Additional context

#627

@@ -212,7 +212,9 @@ class PostgrestBuilder<T, S> implements Future<T> {
int? count;

if (response.request!.method != METHOD_HEAD) {
if (response.request!.headers['Accept'] == 'text/csv') {
if (response.bodyBytes.isEmpty) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Vinzent03, this looks like it will address the exception. Exceptions do interrupt the debugging flow when there is actually nothing exceptional happening.

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants